<?php
  include_once('../classes/class.edit.operation.php');
    
  session_start();
    
  if (isset($_POST['type']))
  { 
    $editOperation = new EditOperation();  
    if($editOperation->process())
    {
     $comtec_id_order = $_POST['comtec_id_order'];
     $type = $_POST['type'];
     if($type==1){
      echo "<script>viewOperation($comtec_id_order)</script>";
     }elseif($type==2){
      echo "<script>loadHome()</script>";   
     }elseif($type==3){
      echo "<script>goBackSearch();</script>";
      echo "<script>searchOperations();</script>";   
     }
     echo "<script>alert('Operacion modificada satisfactoriamente');</script>";
    }else
       {
        echo '<p class="error">';
        echo '<b>'.$editOperation->show_errors().'</b>'; 
        echo '</p>';    
       }
  }
?>
